<template>
  <div class="div">
    <div class="daohang" v-for="(item,index) in list" :key="index">
      <font :class="[isActive==index ?'active':'font']" @click="daohangqiehuan(index)">{{item}}</font>
    </div>
  </div>
</template>
<script>
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";

export default {
  props: ["index"],
  data() {
    return {
      list: [
        "个人资料",
        "写博客",
        "文章管理",
        "我的关注",
        "我的云盘",
        "我的下载",
        "我的收藏",
        "退出"
      ],
      theme3: "dark",
      isActive: 0
    };  
  },
  methods: {
    ...mapMutations(["xggerenindex"]),
    daohangqiehuan(index) {
      this.isActive = index;
      this.xggerenindex(this.isActive);
    }
  },
  mounted() {
    this.isActive = this.index;
    this.xggerenindex(this.isActive);
  },

  computed: {
    ...mapState(["leixing"]),
    ...mapState(["poot"]),
    ...mapState(["user"]),
    ...mapState(["gerenindex"])
  }
};
</script>
<style scoped>
.active {
  font-size: 15px;
  color: #ffd04b;
  padding-right: 25px;
  border-right: 2px #ffd04b solid;
  margin-bottom: 10px;
  display: block;
}
.div::-webkit-scrollbar {
  display: none;
}
.div {
  margin-top: 20px;
  overflow: auto;
  height: 780px;
}
.daohang {
  text-align: right;
}
font {
  font-size: 15px;
  color: #fff;
  padding-right: 25px;
  margin-bottom: 10px;
  display: block;
}
</style>
